syntax = "proto3";

package spqr;

option go_package = "spqr/proto";

enum RouterStatus {
  CLOSED = 0;
  OPENED = 1;
}


message Router {
  string id = 1;
  string address = 2;
  RouterStatus status = 3;
}

service RouterService {
  rpc ListRouters (ListRoutersRequest) returns (ListRoutersReply) {}
  rpc AddRouter (AddRouterRequest) returns (AddRouterReply) {}
  rpc RemoveRouter (RemoveRouterRequest) returns (RemoveRouterReply) {}
  rpc SyncMetadata (SyncMetadataRequest) returns (SyncMetadataReply) {}
}


message ListRoutersRequest {}

message ListRoutersReply {
	repeated Router routers = 1;
}

message AddRouterRequest {
  Router router = 1;
}

message AddRouterReply {
  string id = 1;
}

message RemoveRouterRequest {
  string id = 1;
}

message RemoveRouterReply {}

message SyncMetadataRequest {
  Router router = 1;
}

message SyncMetadataReply {}